package com.lifeng;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * Created by lifeng on 2019/3/18.
 */
@SpringBootApplication
@EnableDiscoveryClient
public class ServiceNacosConsumerStartup {
    public static void main(String[] args) {
        SpringApplication.run(ServiceNacosConsumerStartup.class, args);
    }

    @LoadBalanced
    @Bean
    public RestTemplate resultTemplate(){
        RestTemplate template = new RestTemplate();
        return template;
    }
}
